
#ifndef interface_h
#define interface_h
#include "typedef.h"
class QWidget;
#include <QObject>


/// ----------------------------------------------------------------------------
/// @brief: 通道基类
/// ----------------------------------------------------------------------------
class ichannel_unit : public QObject
{
public:

	virtual ~ichannel_unit(){}

	/// ----------------------------------------------------------------------------
	/// @brief：		初始化
	/// @param: 	const int channel_id - 通道ID
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	virtual int init_(const int channel_id) = 0;


	/// ----------------------------------------------------------------------------
	/// @brief：		初始化通道
	/// @param: 	const sa_def::udp_widget_config & config - config
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	virtual int init_channel_(const sa_def::udp_widget_config& config) = 0;



	/// ----------------------------------------------------------------------------
	/// @brief：		断开通道
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	virtual int uninit_channel_() = 0;

	/// ----------------------------------------------------------------------------
	/// @brief：		释放:窗口，通道，文件记录模块
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	virtual int uninit_() = 0;

	/// ----------------------------------------------------------------------------
	/// @brief：		外部调用
	/// @return: 	QT_NAMESPACE::QWidget* - 无
	/// 			
	/// ----------------------------------------------------------------------------
	virtual QWidget* get_widget_() = 0;
};



/// ----------------------------------------------------------------------------
/// @brief: 发送数据接口
/// ----------------------------------------------------------------------------
class isend_data
{
public:
	~isend_data(){}

	/// ----------------------------------------------------------------------------
	/// @brief：		发送数据
	/// @param: 	const unsigned char * pdata - 发送数据
	/// @param: 	const unsigned int len - 发送数据长度
	/// @return: 	int 
	/// 				0 - 成功
	///					非0 - 失败
	/// ----------------------------------------------------------------------------
	virtual int send_(const unsigned char* pdata, const unsigned int len) = 0;

};


#endif /// interface_h